<?php
namespace Mp\Service\Widget;
use Illuminate\Contracts\Support\Renderable;

class Badge extends Widget implements Renderable{

	protected $label = 'badge';

	protected $class = 'default'; //badge-default bg-danger badge-inverse-success bg-primary bg-info badge-inverse-warning bg-success badge-inverse-default badge-inverse-danger bg-warning bg-warning badge-inverse-primary badge-inverse-info

	protected $size = 'md'; //lg md 

	protected $icon = [];  //['layout' => 'left','icon' => 'envelope'];


	protected $view = 'Mp::widgets.badge';

	private function _init($params){
		$this->label = $params['label'] ?? $this->label;
		$this->size = $params['size'] ?? $this->size;
		$this->type = $params['class'] ?? $this->class;
	
		$this->data = [
			'label' => $this->label,
			'size' => $this->size,
			'class' => $this->class,

		];
	}

	public function render($params = []){
		$this->_init($params);
		return  view($this->view ,$this->data)->render();
	}
}